<?php
namespace app\common\requests;

abstract class PKRequest extends PackingRequest
{

    abstract protected function getPK();

    /**
     * @return array
     * @author yashuai<1762910894@qq.com>
     */
    public function rules()
    {
        $pk = $this->getPK();
        return [
            $pk => 'require|number|egt:1',
        ];
    }

    /**
     * @return array
     * @author yashuai<1762910894@qq.com>
     */
    public function message()
    {
        $pk = $this->getPK();
        return [
            "{$pk}.require" => '缺少记录ID参数',
            "{$pk}.number"  => '记录ID参数类型异常',
            "{$pk}.egt"     => '记录ID参数类型异常'
        ];
    }
}
